package com.fc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 权限表
 * </p>
 *
 * @author 张非
 * @since 2023-07-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="SysPermission对象", description="权限表")
public class SysPermission implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Excel(name = "id", width = 15)
    private String id;

    @ApiModelProperty(value = "父id")
    @Excel(name = "父id", width = 15)
    private String parentId;

    @ApiModelProperty(value = "菜单标题")
    @Excel(name = "菜单标题", width = 15)
    private String name;

    @ApiModelProperty(value = "路径")
    @Excel(name = "路径", width = 15)
    private String url;

    @ApiModelProperty(value = "菜单编码")
    @Excel(name = "菜单编码", width = 15)
    private String perCode;

    @ApiModelProperty(value = "菜单类型(0:一级菜单; 1:子菜单:2:按")
    @Excel(name = "菜单类型(0:一级菜单; 1:子菜单:2:按", width = 15)
    private Integer menuType;

    @ApiModelProperty(value = "是否叶子节点:    1:是   0:不是")
    @Excel(name = "是否叶子节点:    1:是   0:不是", width = 15)
    private Integer isLeaf;

    @ApiModelProperty(value = "菜单状态")
    @Excel(name = "菜单状态", width = 15)
    private Integer status;

    @ApiModelProperty(value = "菜单简介")
    @Excel(name = "菜单简介", width = 15)
    private String description;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty(value = "排序")
    @Excel(name = "排序", width = 15)
    private Integer grade;

    /**
     * 子菜单
     */
    @TableField(exist = false)
    private List<SysPermission> child;


}
